package gewu.suleju.sevice.imp;

import gewu.suleju.dao.iml.IHouseCollectionDao;
import gewu.suleju.model.pojo.HouseCollection;
import gewu.suleju.sevice.IHouseCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HouseCollectionServiceImp implements IHouseCollectionService {
    @Autowired
    private IHouseCollectionDao iHouseCollectionDao;
    @Override
    public boolean findUserIdAndHouseId(Integer userId, Integer houseId) {
        HouseCollection houseCollection = iHouseCollectionDao.findByUserIdAndHouseInforId(userId,houseId);
        if(houseCollection != null){
            return false;
        }
        else{
            return true;
        }


    }

    @Override
    public boolean deleteCollection(Integer userId, Integer houseInforId) {
        iHouseCollectionDao.deleteByUserIdAndHouseInforId(userId, houseInforId);
        return true;
    }

}
